package com.gcb.common.enums;

import lombok.Getter;

/**
 * 用户状态
 *
 * @author tdl
 * @since 2024-04-10
 */
@Getter
public enum StatusEnum {
    OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除");

    private final String code;
    private final String info;

    StatusEnum(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public static String getInfoByCode(Integer code) {
        for (AuthStatusEnum companyAuthStatus : AuthStatusEnum.values()) {
            if (companyAuthStatus.getCode().equals(code)) {
                return companyAuthStatus.getInfo();
            }
        }
        return null;
    }
}
